package org.farm.product.domain.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.farm.product.domain.bo.ProductSpuBo;
import org.farm.product.domain.chain.ProductSpuChainBuilder;
import org.farm.product.domain.service.ProductDomainService;
import org.farm.product.infra.basic.service.ProductSpuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Frank Zou
 * @version v0.0.1
 * @date 2025/4/22
 * @description
 */
@Slf4j
@Service
public class ProductDomainServiceImpl implements ProductDomainService {


    private final ProductSpuService productSpuService;

    private final ProductSpuChainBuilder productSpuChainBuilder;


    @Autowired
    public ProductDomainServiceImpl(
            ProductSpuService productSpuService,
            ProductSpuChainBuilder productSpuChainBuilder) {
        this.productSpuService = productSpuService;
        this.productSpuChainBuilder = productSpuChainBuilder;
    }

    @Override
    public Boolean newProduct(ProductSpuBo productSpuBo) {
        this.productSpuChainBuilder.process(productSpuBo);
        return true;
    }
}
